diff --git a/lib/matplotlib/stackplot.py b/lib/matplotlib/stackplot.py
index c580043eeb..f9957547dc 100644
--- a/lib/matplotlib/stackplot.py
+++ b/lib/matplotlib/stackplot.py
@@ -7,7 +7,7 @@ https://stackoverflow.com/q/2225995/
 """
 
 import numpy as np
-
+from matplotlib.colors import to_rgba
 from matplotlib import _api
 
 __all__ = ['stackplot']
@@ -70,12 +70,16 @@ def stackplot(axes, x, *args,
 
     labels = iter(labels)
     if colors is not None:
-        axes.set_prop_cycle(color=colors)
+        resolved_colors = []
+        for color in colors:
+            resolved_colors.append(to_rgba(color))
+        axes.set_prop_cycle(color=resolved_colors)
 
     # Assume data passed has not been 'stacked', so stack it here.
     # We'll need a float buffer for the upcoming calculations.
     stack = np.cumsum(y, axis=0, dtype=np.promote_types(y.dtype, np.float32))
 
+    first_line = 0.
     _api.check_in_list(['zero', 'sym', 'wiggle', 'weighted_wiggle'],
                        baseline=baseline)
     if baseline == 'zero':
